Skip to content

Add agent dsl to disable instrumentations#1714

Merged
breedx-splk merged 4 commits into
open-telemetry:mainfrom
breedx-splk:suppress_instrumentation_dsl
May 13, 2026
Merged

Add agent dsl to disable instrumentations#1714
breedx-splk merged 4 commits into
open-telemetry:mainfrom
breedx-splk:suppress_instrumentation_dsl

Conversation

@breedx-splk
Copy link
Copy Markdown
Contributor

@breedx-splk breedx-splk commented Apr 30, 2026

Resolves #411.

By default, the instrumentation loader will find all instrumentation on the classpath and load it. This new DSL method allows suppressing some of those instrumentations if they might be unwanted.

I like the simplicity of this approach, because it just leverages the existing mechanism built into the OtelRumConfig from core and the existing InstrumentationConfiguration DSL. One shortcoming, though, is that users might want this to be as lazy as possible -- evaluated just before install time (so that they can make a calculation or whatever). That approach would be considerably more involved.

@breedx-splk breedx-splk requested a review from a team as a code owner April 30, 2026 23:59
@breedx-splk breedx-splk changed the title Add dsl to disable instrumentations Add agent dsl to disable instrumentations Apr 30, 2026
Copy link
Copy Markdown
Member

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a reasonable approach. I'm not convinced on the name, perhaps something like disabledInstrumentations or suppressedInstrumentation is more descriptive?

While reviewing I also noticed that OtelRumConfig has shouldDiscoverInstrumentations(). I'd be inclined to keep the scope of this PR tight, but whether we need something similar should be part of related discussion IMO.

@breedx-splk
Copy link
Copy Markdown
Contributor Author

This feels like a reasonable approach. I'm not convinced on the name, perhaps something like disabledInstrumentations or suppressedInstrumentation is more descriptive?

I didn't include the word 'instrumentation' in the name because it's already scoped to the 'instrumentations' block....which would make it redundant.

instrumentations {
  suppressing (
    "unwanted.instrumentation.name",
    "something.unwanted"
  )
  ...
}

I think I see where you're coming from, though. Nothing else (yet?) in the DSL uses the infinitive verb form (tho it's not super uncommon in other DSLs I think). Maybe you would like suppress or suppressed better? I'm open to changing it.

While reviewing I also noticed that OtelRumConfig has shouldDiscoverInstrumentations(). I'd be inclined to keep the scope of this PR tight, but whether we need something similar should be part of related discussion IMO.

Oh that definitely occurred to me as well, and we should add that....agree not in this PR.

@breedx-splk
Copy link
Copy Markdown
Contributor Author

Created #1716 to follow up on this idea.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.10%. Comparing base (20e3cc1) to head (286904f).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1714      +/-   ##
==========================================
- Coverage   62.41%   62.10%   -0.32%     
==========================================
  Files         160      159       -1     
  Lines        3480     3446      -34     
  Branches      353      347       -6     
==========================================
- Hits         2172     2140      -32     
+ Misses       1209     1206       -3     
- Partials       99      100       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers!

Copy link
Copy Markdown
Member

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks

@breedx-splk breedx-splk merged commit d054576 into open-telemetry:main May 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Programmatically disabling instrumentation on classpath

3 participants